<!-- 历年排名 -->
<template>
	<div class="bg_white pt20">
		<div ref="historyRankChart" style="width:100%; height: 30rem"></div>
	</div>
</template>
<script type="text/javascript">
	import echarts from 'echarts'
	import echartsOptions from '../../assets/js/performace/echartOption'

	export default{
		mixins:[echartsOptions],
		mounted(){
			this.getHistoryRankDatas();
		},
		methods:{
			getHistoryRankDatas(){
				let historyRankChart = echarts.init(this.$refs.historyRankChart)
				this.$http.get(this.$parent.historyRankUrl,{emulateJSON:true})
				.then((response) =>{
					console.log(response);
					this.historyRankOption.xAxis.data = response.data[0].name;
					this.historyRankOption.series.data = response.data[0].type;
					historyRankChart.setOption(this.historyRankOption)
				})
			}
		}
	}
</script>